import { reactive, toRefs } from 'vue';
import router from '@/router';

export default (await import('vue')).defineComponent({
setup() {
const state = reactive({
username: 'default'
});
state.username = localStorage.getItem('user');

const logout = () => {
// 退出登录
localStorage.removeItem('isLogin');
// 去到首页或登录页
router.push('/login');
};


return {
...toRefs(state),
logout
};
}
});
